package com.vint.openjudge;

import java.util.Scanner;

/**
 * 1. easy 水题
 */
public class Openjudeg4098 {
	public static void main(String args[]) throws Exception
	{
		Scanner cin=new Scanner(System.in);
		String line = cin.nextLine();
		int team = Integer.parseInt(line);
		while(team-- > 0) {
			int num = Integer.parseInt(cin.nextLine());
			int first = Integer.MIN_VALUE;
			int two = Integer.MIN_VALUE;
			int a1 = 0;
			int a2 = 0;
			int b1 = 0;
			int b2 = 0;
			int id1 = 0;
			int id2 = 0;
			while(num-- > 0) {
				String[] fruit = cin.nextLine().split(" ");
				int id = Integer.parseInt(fruit[0]);
				int aa = Integer.parseInt(fruit[1]);
				int bb = Integer.parseInt(fruit[2]);
				if(aa + bb > first) {
					a2 = a1;
					b2 = b1;
					id2 = id1;
					a1 = aa;
					b1 = bb;
					id1 = id;
					two = first;
					first = aa + bb;
					continue;
				}
				if(aa + bb < first && aa + bb > two) {
					two = aa + bb;
					a2 = aa;
					b2 = bb;
					id2 = id;
				}
			}
			System.out.println(id2 + " " + a2 + " " + b2 + " " + two );

		}
	}
}
